Skip to content

fix(terminal): close tab on process end and speed up long-press select - #2587

Merged
bajrangCoder merged 2 commits into
mainfrom
fix/terminal-exit-tab-and-selection-hold
Aug 3, 2026
Merged

fix(terminal): close tab on process end and speed up long-press select#2587
bajrangCoder merged 2 commits into
mainfrom
fix/terminal-exit-tab-and-selection-hold

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Close the terminal tab when the PTY exits or the socket drops, not only when the AXS exit JSON arrives, so users no longer get a dead zombie tab after typing exit. Also lower the default touch selection hold from 600ms to 400ms so long-press select feels more responsive.

Close the terminal tab when the PTY exits or the socket drops, not only
when the AXS exit JSON arrives, so users no longer get a dead zombie tab
after typing exit. Also lower the default touch selection hold from
600ms to 400ms so long-press select feels more responsive.
@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Consolidates terminal shutdown handling and makes touch selection more responsive.

  • Routes process exits, unexpected socket closures, and socket errors through one idempotent tab-cleanup path.
  • Distinguishes lifecycle text messages from binary terminal output and suppresses teardown noise after intentional closure.
  • Reduces the default long-press selection delay from 600 ms to 400 ms.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/components/terminal/terminal.js Adds lifecycle state, filters binary frames from exit-message parsing, reports disconnect context, and makes termination idempotent.
src/components/terminal/terminalManager.js Unifies exit, disconnect, and error cleanup through an idempotent session-finishing path that removes the terminal tab.
src/components/terminal/terminalDefaults.js Changes the configured default touch-selection hold duration from 600 ms to 400 ms.
src/components/terminal/terminalTouchSelection.js Aligns the touch-selection implementation fallback with the new 400 ms default.

Sequence Diagram

sequenceDiagram
    participant WS as WebSocket
    participant TC as TerminalComponent
    participant TM as TerminalManager
    participant Tab as Terminal Tab
    alt Exit control message
        WS->>TC: Text frame (type: exit)
        TC->>TM: onProcessExit(data)
    else Unexpected disconnect
        WS->>TC: close event
        TC->>TM: onDisconnect(info)
    else Socket error
        WS->>TC: error event
        TC->>TM: onError(error)
    end
    TM->>TM: finishTerminalSession()
    TM->>TC: dispose()
    TM->>Tab: remove()
Loading

Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile

Comment thread src/components/terminal/terminal.js Outdated
@bajrangCoder

Copy link
Copy Markdown
Member Author

@greptile

@bajrangCoder
bajrangCoder added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit a9e7a1a Aug 3, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Aug 3, 2026
@bajrangCoder
bajrangCoder deleted the fix/terminal-exit-tab-and-selection-hold branch August 3, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant